package com.juku2024.juku.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.juku2024.juku.R
import java.util.*

class FeedTypeAdapter(data: ArrayList<String>) :
    BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_feed_type, data), LoadMoreModule {

    var selectedPos = 0

    override fun convert(holder: BaseViewHolder, item: String) {
        holder.setText(R.id.tvFeedbackType, item)
        if (selectedPos == holder.layoutPosition) {
            holder.setTextColorRes(R.id.tvFeedbackType, R.color.cf1f1f1)
            holder.setBackgroundResource(R.id.tvFeedbackType, R.drawable.shape_feedback_type_selected)
        } else {
            holder.setTextColorRes(R.id.tvFeedbackType, R.color.c4D4D4D)
            holder.setBackgroundResource(R.id.tvFeedbackType, R.drawable.shape_feedback_type_normal)
        }
    }

}